#INCLUDE 'PROTHEUS.CH'
#INCLUDE 'RWMAKE.CH'
#INCLUDE 'FONT.CH'
#INCLUDE 'COLORS.CH'
#INCLUDE "topconn.ch"

User Function SearchAnex(cAuxiliar)
	Local _cTxTAux := ""
	Local _cTxTAux2 := ""
                
	cQuery := " SELECT ZZ4.ZZ4_DESC "
	cQuery += " FROM "+RetSqlName("ZZ8")+" ZZ8 INNER JOIN "+RetSqlName("ZZ4")+" ZZ4 ON ZZ8.ZZ8_DOC = ZZ4.ZZ4_COD "
	cQuery += " WHERE ZZ8.D_E_L_E_T_ <> '*' AND ZZ8.ZZ8_VOLUME = '"+cAuxiliar+"'"

	TCQUERY cQuery NEW ALIAS "EZ8"   

	dbselectArea("EZ8")
EZ8->(DBGOTOP())
WHILE !EZ8->(EOF())
	_cTxTAux+= ALLTRIM(EZ8->ZZ4_DESC)+","
	EZ8->(DBSKIP())
enddo
	dbclosearea("EZ8")

_cTxTAux2 := subStr(_cTxTAux,1,len(AllTrim(_cTxTAux))-1)
                                       
Return _cTxTAux2